#ifndef FIELD3D_H
#define FIELD3D_H

#include <cmath>
#include <vector>

#include "../Field/Field.h"


template<class Type>
class Field3D : public Field<Type>
{

public:
    Field3D();

    Field3D( std::vector<int> dims );

    Field3D( std::vector<int> dims, std::string name );

    ~Field3D();

    void allocate_dims(std::vector<int> dims );


    inline Type& operator () (int i,int j,int k)
    {
        PICDEBUGEXECUTE(if (i>=this->dims_[0] || j>=this->dims_[1] || k >= this->dims_[2]) log_error<<name << "Out of limits & "<< i << " " << j << " " << k;);
        return data_3D[i][j][k];
    };

    inline Type operator () (int i,int j,int k) const {
        PICDEBUGEXECUTE(if (i>=this->dims_[0] || j>=this->dims_[1] || k >= this->dims_[2]) log_error<<name << "Out of limits "<< i << " " << j << " " << k;);
        return data_3D[i][j][k];
    };

    Field3D& operator=(const Field3D& field3D);

    Type*** data_3D;


private:


};

#endif
